package com.feng.lbs;

import android.content.Intent;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;

public class MyMapActivity extends MapActivity 
{
	private MapView maps = null;
	private MapController mapCtrler = null;
	
	//private TextView title = null;

	@Override
	protected void onCreate(Bundle icicle) 
	{
		// TODO Auto-generated method stub
		super.onCreate(icicle);
		setContentView (R.layout.mapviews);
		
		//this.title = (TextView)findViewById (R.id.title);
		//this.title.setText("Now Location !");
		this.initMapView();
	}
	
	private void initMapView ()
	{
		this.maps = (MapView)findViewById (R.id.mapview);
		this.mapCtrler = this.maps.getController();
		
		this.maps.setSatellite(false);
		this.maps.setStreetView(true);
		this.maps.displayZoomControls(false);
		this.maps.setClickable(true);
		
		this.mapCtrler.setZoom(17);
		
		Intent intent = getIntent ();
		int lat = intent.getIntExtra ("Lat", 31265676);
		int lng = intent.getIntExtra ("Lng", 121435103);
		//System.out.println ("lat: " + lat + ", lng: " + lng);
		GeoPoint now = new GeoPoint (lat, lng);
		this.mapCtrler.animateTo(now);
	}

	@Override
	protected boolean isRouteDisplayed() 
	{
		// TODO Auto-generated method stub
		return false;
	}

}
